import { defineStore } from 'pinia'

const TOKEN_KEY = 'token'

export const useAppStore = defineStore('app', () => {

  const router = useRouter()

  const menuIndex = ref(0)
  const moduleIndex = ref(0)


  const selectMenu = (item, index) => {
    // menuIndex.value = index
    router.replace(item.value)
  }

  const selectModule = (item, index) => {
    moduleIndex.value = index
  }


  return {
    menuIndex,
    moduleIndex,

    selectMenu,
    selectModule,
  }
})
